<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<title>vue</title>
        <!-- 引入vue文件-->
		<script src="https://cdn.bootcss.com/vue/2.2.2/vue.min.js"></script>
		<!--引入第三方库-->
		<link href="https://cdn.jsdelivr.net/npm/animate.css@3.5.1" rel="stylesheet" type="text/css">
	</head>
	<style>
		#sign{
			width:100px;
			height: 100px;
			background: red;
		}
	</style>
	<body>
		<div id="vue">
			<button @click="toggle">{{btnName}}</button>
			<!--使用css第三库动画样式-->
			<transition name="hah"
				enter-active-class="animated zoomInLeft"
		    	leave-active-class="animated zoomOutRight"	
			>
				<div id="sign" v-if="flag"></div>
			</transition>
		</div>
	</body>
	<script type="application/javascript">
		new Vue({
			el:'#vue',
			data:{
				btnName:'切换',
				flag:true
			},
			methods:{
				toggle:function(){
					this.flag=!this.flag;
				}
			}
		})
	</script>
</html>
